<?php
session_start();
require_once("bdd.php");

if( isset($_POST['message']) ) {

$text = addslashes( $_POST['message'] );

 
$date =  date('Y-m-d');



$connexion->exec("INSERT INTO mur (message, iduser, date)
					VALUES( '".$text."', ".$_SESSION['utilisateur'].",  '".$date."')");

					

					 $hostAccueil  = $_SERVER['HTTP_HOST'];
					 $url = '/avis.php';
					header("Location: http://$hostAccueil$url");
}
else {
	 $hostAccueil  = $_SERVER['HTTP_HOST'];
 header("Location: http://$hostAccueil");
}

?>